//
//  XSQADHttpManager.m
//  BuDeJie
//
//  Created by Sem on 2018/6/28.
//  Copyright © 2018年 SEM. All rights reserved.
//
#define XSQ_AD_LIST @"http://mobads.baidu.com/cpro/ui/mads.php"
#import "XSQADHttpManager.h"
#import "XSQADModel.h"
@implementation XSQADHttpManager
//获取AD广告
+(void) getAD:(NSDictionary *) params
      success:(void (^)(NSArray *adArr))success
      failure:(void (^)(NSError* err))failure{
    [AFHttpTool requestWihtMethod:RequestMethodTypeGet baseurl:XSQ_AD_LIST url:@"" params:params success:^(id response) {
        NSDictionary *dic = (NSDictionary *)response;
        NSArray *arr = dic[@"ad"];
        NSArray *adArr=[XSQADModel mj_objectArrayWithKeyValuesArray:arr];
        success(adArr);
    } failure:^(NSError *err) {
        [SVProgressHUD showErrorWithStatus:@"网络繁忙,请稍后再试!"];
        failure(err);
    }];
}
@end
